Skip to content

fix(resend): recognize Resend's new receiving MX host (forge.rmta.net) - #323

Merged
hieunc229 merged 2 commits into
hieunc229:mainfrom
manoel0810:fix/resend-receiving-mx
Nov 18, 2026
Merged

hieunc229 merged 2 commits into
hieunc229:mainfrom
manoel0810:fix/resend-receiving-mx

Conversation

@manoel0810

Copy link
Copy Markdown
Contributor

Problem

Setting up Resend receiving fails with:

Resend did not return a receiving MX record for this domain.

Resend now returns the inbound MX with a new host that isInboundSmtpMx (SES-style inbound-smtp.<region>.amazonaws.com) does not match. GET /domains/:id for a domain in sa-east-1:

{"record":"Receiving","name":"","value":"receive-sae1.forge.rmta.net","type":"MX","priority":4,"status":"verified"}

Because inboundMx() finds nothing, setupResendReceiving throws before ensureWebhook, so the email.received webhook is never created and inbound mail never reaches Mailflare.

Fix

  • Add isResendInboundMx in receiving-dns.ts: the existing SES-style host or receive-<region>.forge.rmta.net.
  • inboundMx() also accepts the MX Resend labels record: "Receiving", so a future host change doesn't break setup again.
  • Use isResendInboundMx for the status fallback (hasMxMatching) and for removeResendReceiving, so the MX is detected and cleaned up for Cloudflare-managed zones too.
  • SES receiving keeps using isInboundSmtpMx unchanged.

Testing

Self-hosted Docker + Resend (send and receive), manual DNS zone:

  • Before: POST /api/domains/:id/receiving/resend → Resend did not return a receiving MX record….
  • After: {"ok":true}; Resend logs show POST /webhooks 201 and POST /domains/:id/verify 200; the domain panel shows every receiving step green; inbound and outbound mail work end to end.

Lint and the test suite were not run locally.

Supersedes #296, which targeted the same bug but was closed with a large unrelated diff; this PR changes only the two files above.

🤖 Generated with Claude Code

manoel0810 and others added 2 commits November 16, 2026 16:30
Resend now returns the inbound MX as receive-<region>.forge.rmta.net
(record: "Receiving"), which isInboundSmtpMx does not match, so
setupResendReceiving failed with "Resend did not return a receiving MX
record for this domain." and the webhook was never created.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	src/lib/domains/resend-receiving.ts
@hieunc229
hieunc229 merged commit 48ed51c into hieunc229:main Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants